package cn.lg.soar.system.biz.modules.auth.model;

import cn.lg.soar.core.annotations.constraints.group.Create;
import cn.lg.soar.core.annotations.constraints.group.Update;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import lombok.Getter;
import lombok.Setter;

import java.util.List;

/**
 * @author luguoxiang 469599794@qq.com
 * @Date: 2025/5/3 18:07
 * 开源项目：https://gitee.com/lgx1992/lg-soar 求star！请给我star！请帮我点个star！
 */
@Getter
@Setter
public class ComponentBatchCreateVO {

    /** 组件名称 */
    @NotBlank(message = "组件名称不能为空", groups = { Create.class, Update.class })
    @Schema(description = "组件名称")
    private String name;

    /** 组件路径 */
    @NotBlank(message = "组件路径不能为空", groups = { Create.class, Update.class })
    @Schema(description = "组件路径")
    private String path;

    /** 权限码 */
    @NotBlank(message = "权限码不能为空", groups = { Create.class, Update.class })
    @Schema(description = "权限码")
    private String code;

    /** 接口权限 */
    @Schema(description = "接口权限")
    private List<String> permits;

    /** 页面元素 */
    @Schema(description = "页面元素")
    private Element[] elements;


    @Getter
    @Setter
    public static class Element {
        /**
         * 名称
         */
        @NotBlank(message = "按钮名称不能为空", groups = { Create.class, Update.class })
        @Schema(description = "名称")
        private String name;

        /**
         * 权限码
         */
        @NotBlank(message = "按钮权限码不能为空", groups = { Create.class, Update.class })
        @Schema(description = "权限码")
        private String code;

        /**
         * 接口权限ids
         */
        @Schema(description = "接口权限ids")
        private List<String> permits;
    }

}
